package org.millioncall.yueyoga.admin.dao.impl;

import java.util.Map;

import org.millioncall.openplatform.common.PaginateParams;
import org.millioncall.openplatform.common.PaginatedList;
import org.millioncall.openplatform.common.StartLimitPairImpl;
import org.millioncall.openplatform.dao.PreparedQuery;
import org.millioncall.yueyoga.admin.dao.BaseDao;
import org.millioncall.yueyoga.admin.dao.ContactDAO;
import org.millioncall.yueyoga.admin.model.Contact;
import org.springframework.stereotype.Repository;

@Repository
public class ContactDAOImpl extends BaseDao implements ContactDAO{

	@Override
	public int deleteByPrimaryKey(Integer id) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int insert(Contact record) {
		return this.getPagableSqlSessionTemplate().insert("insertContact", record);
	}

	@Override
	public int insertSelective(Contact record) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public Contact selectByPrimaryKey(Integer id) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public int updateByPrimaryKeySelective(Contact record) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int updateByPrimaryKeyWithBLOBs(Contact record) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int updateByPrimaryKey(Contact record) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public PaginatedList<Contact> findContactByMemberId(Map<String, Object> map, int start,
			int limit) {
		PreparedQuery<Contact> pq = this.getPagableSqlSessionTemplate()
				.findAll("findContactByMemberId",map);
		PaginatedList<Contact> pl = pq.list(new PaginateParams(
				new StartLimitPairImpl(start, limit)));
		return pl;
	}
}
